package com.infore.remoteControl.repository;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.infore.remoteControl.entity.protocolEntity.ProtocolType;

@Repository
public interface IProtocolTypeRepository extends JpaRepository<ProtocolType, String>, JpaSpecificationExecutor<ProtocolType> {
	
	/** 分页查询(协议序号排序) **/
	Page<ProtocolType> findByOrderByCode(Pageable pageable);
	/** 按协议序号排序查询 **/
	List<ProtocolType> findByOrderByCode();
	/** 批量删除 **/
	@Modifying
	@Transactional
	int deleteByProtocolTypeIdIn(List<String> ids);
	/** 根据协议类型名称查询 **/
	List<ProtocolType> findByName(String name);
	/** 根据协议类型编号查询 **/
	List<ProtocolType> findByCode(String code);
}
